#ifndef __DIRECTOR_H__
#define __DIRECTOR_H__

#include "stdafx.h"
#include "Scene.h"
#include <string>
#include <map>

using namespace std;

typedef std::map<string,Scene*> SceneMap;

class Director
{

	/*		How to use this class		*/
	// Director* dir = Director::getInstance();
	// dir->Init(argc,argv);
	// dir->AddScene("myScene", new myScene, true);

	SINGLETON_DECLARE(Director);
	SYNTHESIZE_READONLY(Scene*, CurrentScene, CurrentScene);
	SYNTHESIZE_READONLY(Scene*, PreviousScene, PreviousScene);
	SYNTHESIZE_READONLY_PASS_BY_REF(SceneMap, SceneList, SceneList);

	SceneMap sList;

public:
	Director(void);			// Constructor
	~Director(void);		// Destructor
	
		/* OPENGL INITIALISATION */

	// Simple one-liner to initialise your OpenGL program
			void		Init				(int argc, char ** argv, const char* title);

	// Resize your window
			void		SetWindowSize		(int width, int height);



		/* SCENE MANAGEMENT */

	// Add a Scene to the list, with the option of running the newly added scene
			void		AddScene			(string name, Scene * scene, bool bRunScene = false);

	// Change the Scene
			void		ChangeScene			(string name);



		/* SCENE FUNCTIONS */

	// Update function
	friend	void		SceneIdle			(void);

	// Render function
	friend	void		SceneDisplay		(void);

	// Function to check for keys that are pressed
	friend	void		SceneKeyboardDown	(unsigned char key, int x, int y);

	// Function to check for keys that are released
	friend	void		SceneKeyboardUp		(unsigned char key, int x, int y);
	
	// Function to check for special keys that are pressed
	friend	void		SceneSpecialDown	(int key, int x, int y);

	// Function to check for special keys that are released
	friend	void		SceneSpecialUp		(int key, int x, int y);

	// Function to check for button press
	friend	void		SceneMouse			(int button, int state, int x, int y);

	// Function to check for mouse movement when the buttons are pressed
	friend	void		SceneMotion			(int x, int y);

	// Function to check for mouse movement when the buttons are not pressed
	friend	void		ScenePassiveMotion	(int x, int y);
};

#endif // __DIRECTOR_H__ //